﻿@using NewsMine.DomainObjects;
@using NewsMine.DataManagers;
@{
    ViewBag.Title = "Look at news";
    // Layout = "~/Views/Shared/_Layout.cshtml";

    string selectedDomainName = string.Empty;

    QResult DataFromController = (QResult)Model;
    DataFromController.SortWebSitesByAlexaRank();
    bool IsImageDisplayEnabled = ((QResult)Model).IsImageDisplayEnabled;

    List<FeedItem> feedItemsWithImage = new List<FeedItem>();
    List<FeedItem> feedItemsWithOutImage = new List<FeedItem>();

    foreach (FeedItem feedItem in DataFromController.FeedItems)
    {
        if (string.IsNullOrEmpty(feedItem.ImageUrl))
        {
            feedItemsWithOutImage.Add(feedItem);
        }
        else
        {
            feedItemsWithImage.Add(feedItem);
        }
    }


    string previousPageLink = DataFromController.CurrentUrl + "&pgno=" + (DataFromController.PageNumber - 1).ToString();
    string nextPageLink = DataFromController.CurrentUrl + "&pgno=" + (DataFromController.PageNumber + 1).ToString();

    string selectedLanguage = ((QResult)Model).CurrentLanguage;

    Layout = "~/Views/Shared/_3ColumnMasterLayout.cshtml";

    string tempTitle = string.Empty;
    string truncatedTitle = string.Empty;
    int titleDisplaySize = 150;

    string[] availableCategories = WebApp1.Models.CategoryMaster.GetAvailableCategories();

    string isLanguageMenuDisplay = "none";
    string languageMenuHeight = "0px";

    if (((QResult)Model).CurrentLanguageWebsites != null && ((QResult)Model).CurrentLanguageWebsites.Count > 0)
    {
        isLanguageMenuDisplay = "inline";
        languageMenuHeight = "auto";
    }
    bool isAdminPortal = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings.Get("IsAdminPortal"));

    bool isFeedIsAvailable = (((QResult)Model).FeedItems != null && ((QResult)Model).FeedItems.Count > 0);

    var currentDomain = ((QResult)Model).CurrentDomain;

    if (currentDomain != null)
    {

        selectedDomainName = currentDomain.Domain;
    }


    string currentLanguageName = ((QResult)Model).CurrentLanguage;

    int pageNumber = ((QResult)Model).PageNumber;


    var tempWebSiteName = string.Empty;

    if (currentDomain != null)
    {
        tempWebSiteName = DataFromController.CurrentDomain.LocalName;

        if (string.IsNullOrEmpty(tempWebSiteName))
        {
            tempWebSiteName = DataFromController.CurrentDomain.Name;
        }
    }

    int maxItemsInSubMenu = -1;

    var channels = NewsMine.DataManagers.ChannelManager.GetChannelsForMainMenu();
    
    if( !string.IsNullOrEmpty(currentLanguageName) )
    {
        channels = (from ch in channels
                    where !string.IsNullOrEmpty(ch.Language) && ch.Language.ToLower() == currentLanguageName.ToLower()
                    select ch).ToList();
        
    }
    
    
    
}
<script src="@Url.Content("~/scripts/blocksit.js")?v=@WebApp1.Models.WebAppMetaData.ContentVersion"></script>
<script>

    window.setInterval(yourfunction, 10000);

    var numberOfColumns = 3;
    var numberOfColumnsInWebsitesGrid = 8;
    var maringsInPixels = 20;
    var webSitesLogosGapInPixels = 20;

    var currentGridBoxSize = 0;

    function yourfunction() { $(window).resize(); }

    function sendAjaxRequestTagModification(url, feedid) {
        var jqxhr = $.ajax(url)
        .fail(function (msg) { alert("Error...." + msg); })
        .done(function (msg) {
            //alert("Success..." + msg);
            $(".tagBox-" + feedid).remove();

            var output = "";
            var parts = msg.split(',');

            $.each(parts,
        function (key, part) {
            //output += '<span>' + part + '</span>';
            output += "<span class=\"tagBox-" + feedid + "\" style='border-radius:5px; margin-right:5px;margin-bottom:3px;border:1px solid lightgray;color:Gray;padding:2px;'><span><a href='/category/" + part + "'>" + part + " </a> <a style='color:red;margin-left:1px;' href=\"javascript:sendAjaxRequestTagModification('/websiteinfo/removetagfromfeed?feedid=" + feedid + "&tag=" + part + "'," + feedid + ")\">&times;</a></span></span>";
        });

            $("#tagBox-" + feedid).html(output);
        });
    }

    var isImageSizeInitialized = false;


    function ResizeAllMainContainersAccordingToWindowSize() {

        var currentWindowWidth = $(window).width();

        if (columnMode == "0" || columnMode == "1" || columnMode == "2") {

            if (columnMode == "0") {
                imageDisplay = "none";
            }
            else {
                imageDisplay = "inline";
            }

            $(".newsItemImage").css('display', imageDisplay);


            if (currentWindowWidth > 990) {
                maringsInPixels = currentWindowWidth - 990;

                if (columnMode == "1" || columnMode == "0")
                    numberOfColumns = 1;

                if (columnMode == "2")
                    numberOfColumns = 2;
            }
            else {
                maringsInPixels = (currentWindowWidth * 0.033) * 2;
                numberOfColumns = Math.round((currentWindowWidth - maringsInPixels) / defaultColumnWidth);
            }
        }
        else {

            maringsInPixels = (currentWindowWidth * 0.033) * 2;
            numberOfColumns = Math.round((currentWindowWidth - maringsInPixels) / defaultColumnWidth);
        }

        //numberOfColumnsInWebsitesGrid = Math.round((currentWindowWidth - maringsInPixels) / 180);

        //        if (numberOfColumns > 2)
        //            numberOfColumns = 2; ;

        var w = ($(window).width() - maringsInPixels) + "px";

        if (currentWindowWidth < 900) {
            $('.affix').css('position', 'static');
        }
        else {
            $('.affix').css('position', 'fixed');
        }

        $('body').css('width', w);
        //$('body').css('padding', '30px');

        $("#container").css('width', w);
        $("#websiteContainer").css('width', w);


        ResizeTitleSizes();

        $('#container').BlocksIt({
            numOfCol: numberOfColumns,
            offsetX: 10,
            offsetY: 10
        });

        if (currentWindowWidth < 900) {
            $(".bgscr").css('display', 'none');
        }
        else {
            $(".bgscr").css('display', 'inline');

        }

        //        $('#websiteContainer').BlocksIt({
        //            numOfCol: numberOfColumnsInWebsitesGrid,
        //            offsetX: webSitesLogosGapInPixels,
        //            offsetY: webSitesLogosGapInPixels
        //        });

        if (isImageSizeInitialized == false) {
            InitializeImageSizes();
            isImageSizeInitialized = true;
            ResizeAllMainContainersAccordingToWindowSize();
        }


    }

    function ResizeTitleSizes() {

        var min = 23;
        var max = 26;

        var titleBoxes = $("div.newsItemTitleBox");

        if (titleBoxes.length > 0) {

            //            var sampleTitleBoxSize = $(titleBoxes[0]).width();

            //            var currentWindowWidth = $(window).width();


            //            var calcFontSize = (max) * (sampleTitleBoxSize / 400);


            //            if (calcFontSize > max)
            //                calcFontSize = max;

            //            if (calcFontSize < max)
            //                calcFontSize = min;

            if (columnMode == "1" || columnMode == "0") {
                calcFontSize = 28;
                if ($(window).width() < 500) {
                    calcFontSize = 18;
                }
                if ($(window).width() < 240) {
                    calcFontSize = 16;
                }
            }
            else
                if (columnMode == "2")
                    calcFontSize = 25;
                else
                    calcFontSize = min;

            if ($(window).width() < 500) {
                calcFontSize = 18;
            }
            if ($(window).width() < 240) {
                calcFontSize = 16;
            }

            for (var i = 0; i < titleBoxes.length; i++) {
                $(titleBoxes[i]).css('font-size', calcFontSize.toString() + "px");
            }
        }






    }

    function InitializeImageSizes() {
        var images = $("img.newsItemImage");

        //todo: image cropping by keeping negative margins is disabled by using false flag, need to reuse this block for some thing else;
        for (var i = 0; i < images.length; i++) {

            $(images[i]).attr("src", $(images[i]).attr("data-original"));

            var imgWidth = $(images[i]).attr("w");
            var imgHeight = $(images[i]).attr("h");

            if (imgWidth == 0)
                continue;



            if (imgWidth > 0) {

                var imageBox = $(images[i]).parent(".newsItemImageBox")[0];
                var imageBoxWidth = $(imageBox).width();




                imageBoxWidth = imageBoxWidth - 20;

                if (imgWidth > imageBoxWidth) {
                    imgHeight = imgHeight * (imageBoxWidth / imgWidth);
                }


                $(images[i]).css('height', imgHeight.toString() + "px");

                images[i].onload = function () {
                    $(this).css('height', "auto");


                }
            }
        }
    }

    $(document).ready(function () {
        // $('#bread-nav').affix();
       // $('#nav-category').affix();
        

        ResizeAllMainContainersAccordingToWindowSize();

        $(window).resize();

        //blocksit define
        $(window).load(function () {
            $(window).resize();
        });

        //window resize
        var currentWidth = $(window).width();

        $(window).resize(function () {
            ResizeAllMainContainersAccordingToWindowSize();
        });
    });
</script>
<div id="nav-category" style="z-index:200;text-align: justify; border-top: 0px solid #a00; background-color:#fcfcff;">
    <div style="border:0px solid #fff;">
    <ul class="nav nav-pills" style="margin:0px;">

        @{
            List<NewsMine.DomainObjects.WebSiteInfo> websites = new List<NewsMine.DomainObjects.WebSiteInfo>();

            websites = ((QResult)Model).CurrentLanguageWebsites;

            string websiteName = string.Empty;

            int webSiteCounterTemp = 0;

            foreach (Channel ch in channels)
            {
                if(DataFromController.CurrentChannel!=null && !string.IsNullOrEmpty(DataFromController.CurrentChannel.Name) 
                    && !string.IsNullOrEmpty(ch.Name) 
                    && ch.Name.ToLower()== DataFromController.CurrentChannel.Name.ToLower())
                {
                     <li class="active"><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/channel/@ch.Name" >
                    @Html.Raw(ch.DisplayName)
                
                </a></li>
                    
                }
                else
                {
                    <li style=""><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/channel/@ch.Name" >
                    @Html.Raw(ch.DisplayName)
                
                </a></li>
                }
            }
            
            }

             <li><button class="btn btn-link" tabindex="-1" style="margin:5px;padding-right:5px;font-size:12px;color:#555" data-toggle="collapse" data-target="#demo">
                <b>More News Sources </b><span class="caret"></span>
            </button></li>
            

             </ul>
            
             <ul class="nav nav-pills" style="margin:0px;">
            @{
                
            for (int i = 0; i < websites.Count; i++)
            {
                if (i >= maxItemsInSubMenu)
                {
                    break;
                }
                
                var website = websites[i];

                websiteName = string.Empty;

                websiteName = website.LocalName;

                if (string.IsNullOrEmpty(websiteName))
                {
                    websiteName = website.Name;
                }

                if (!string.IsNullOrEmpty(selectedDomainName) && selectedDomainName.ToLower() == website.Domain.ToLower())
                {
            <li class="active" style=""><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" >
                <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(websiteName)
            </a></li>
                }
                else
                {
            <li><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" >
                <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(websiteName)
            </a></li>
                }

               
            }

            
            
             }

             

           

            </ul>
           
    <ul id="demo" class="nav nav-pills collapse" style="margin-bottom:6px;">

            @{
                
                websites = new List<NewsMine.DomainObjects.WebSiteInfo>();

                websites = ((QResult)Model).CurrentLanguageWebsites;

                if (websites.Count > maxItemsInSubMenu + 1)
                {

                    for (int i = maxItemsInSubMenu + 1; i < websites.Count && i < 35; i++)
                    {
                        var website = websites[i];

                        websiteName = string.Empty;

                        websiteName = website.LocalName;

                        if (string.IsNullOrEmpty(websiteName))
                        {
                            websiteName = website.Name;
                        }

                        if (!string.IsNullOrEmpty(selectedDomainName) && selectedDomainName.ToLower() == website.Domain.ToLower())
                        {
            <li class="active" style=""><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" >
                <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(websiteName)
            </a></li>
                        }
                        else
                        {
            <li><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" >
                <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(websiteName)
            </a></li>
                        }

                    }



                }



            }

          

   
    </ul>

    </div>
</div>



<section id="wrapper" style="margin-top:0px;">

   @if (DataFromController.CurrentDomain != null)
   {
       <div class="topPageTitle">
       <h1> <img style="max-height:70px;" class="img-rounded" src="@DataFromController.CurrentDomain.Logo1Uri" />  @tempWebSiteName News</h1>
       </div>
   }
   else if (DataFromController.CurrentLanguage != null)
   {
        <div class="topPageTitle">
       <h1> @DataFromController.CurrentLanguage.ToUpperInvariant() News</h1>
       </div>

   }
   
   
@* <div id="bread-nav" data-spy="affix" data-offset-top="200" style="border:1px solid #fff;font-weight:bolder;z-index:200;">*@


 <div id="bread-nav" style="border:1px solid #fff;font-weight:bolder;z-index:200;">

<ul class="breadcrumb" style="margin-bottom:0px;background-color:rgba(255,255,255,0.95);text-align:left;color:Red;">

@{
    string tempPageInfo = string.Empty;

    if (pageNumber > 0)
    {
        tempPageInfo = "page " + pageNumber.ToString() + "";
    }

    if (string.IsNullOrEmpty(selectedDomainName) && !string.IsNullOrEmpty(currentLanguageName))
    {
        
        
    <li><a href="/language/@currentLanguageName">
        @System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(currentLanguageName) News (All websites) </a> 
        <span style="color:#a00;">»</span></li>
        <li class="active"><a>
            @tempPageInfo </a> </li>
    }
    else
        if (!string.IsNullOrEmpty(selectedDomainName) && !string.IsNullOrEmpty(((QResult)Model).CurrentLanguage))
        {
            
    <li><a href="/language/@currentLanguageName">
         @System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(currentLanguageName) News (All websites)</a> <span style="color:#a00;">»</span></li>
    
        
     <li><a href="/source/@selectedDomainName">
      <img src='https://plus.google.com/_/favicon?alt=feed&domain=@selectedDomainName ' style="padding-right:8px;width:20px;"/>
        @tempWebSiteName  </a> <span style="color:#a00;">»</span></li>
    <li class="active"><a>
      
        @tempPageInfo </a></li>
            

        }
        }

</ul>  
 </div>     
 
 
 
 

@if (isFeedIsAvailable == false)
{
    <div style="background-color:#fff;margin:10px;padding-bottom:10px;">
    <table>
    <tr>
       
    <td> <img src="@Url.Content("~/content/img/pgnotfound.jpg")" alt="feed not found" />
    </td>
    <td><div style="font-size: 20px;color:red;margin:10px;">
            <p>OOPS... some thing wrong with this. Try selecting other news source please... </p>
            Happy
            News Reading....</div>
    
    </td>
    </tr>
    </table>
    </div>
        
}  
   
   
<div id="container"  style="background-color:transparent;margin-left:auto;margin-right:auto;text-align:center;">

          

@{
    List<FeedItem> feeds = ((QResult)Model).FeedItems;
    string webSiteIconUrl = "https://plus.google.com/_/favicon?alt=feed&domain=eenj.net";




    for (int i = 0; i < feeds.Count; i++)
    {


        feeds[i].Title = System.Text.RegularExpressions.Regex.Replace(feeds[i].Title, @"\s+", " ");


        tempTitle = feeds[i].Title;

        if (!string.IsNullOrEmpty(tempTitle))
        {
            tempTitle = tempTitle.Replace("+", "-");
            tempTitle = NewsMine.Utilities.Extensions.TruncateAtWord(tempTitle, 70);
            tempTitle = HttpUtility.UrlEncode(tempTitle.Replace("+", "-"));
        }

        truncatedTitle = feeds[i].Title;

        if (!string.IsNullOrEmpty(truncatedTitle))
        {
            truncatedTitle = NewsMine.Utilities.Extensions.TruncateAtWord(truncatedTitle, titleDisplaySize);
        }

        // this is temp fix, for one of the malayalam channel.
        if (truncatedTitle.Contains("<!--") || truncatedTitle.Contains(".popover();")
            || truncatedTitle.StartsWith("आगे »")
            )
        {
            continue;
        }


        int reminder = i % 10;
        Random rnd = new Random(i * i);
        int minValue = 80;
        int gapValue = 200 - minValue;

        string temp = (minValue + rnd.Next(reminder, gapValue)).ToString() + "," +
            (minValue + rnd.Next(reminder, gapValue)).ToString() + "," +
            (minValue + rnd.Next(reminder, gapValue)).ToString();

        string color = "rgb(" + temp + ")";
        string colorWithTrans = "rgba(" + temp + ",0.7)";

        string targetLink = "/go?t=" + HttpUtility.UrlEncode(tempTitle) + "&u=" + HttpUtility.UrlEncode(feeds[i].Link) + "&id=" + @feeds[i].ID.ToString();
        
        if(!KeyWordManager.IsDomainSupportsIframe(feeds[i].Domain))
        {
            targetLink = targetLink + "&ni=y";
        }
        

        int imageHeight = feeds[i].ImageHeight;
        int imageWidth = feeds[i].ImageWidth;

        //string colorWithTrans = "rgba(" + (minValue + rnd.Next(reminder, gapValue)).ToString() + "," +
        //   (minValue + rnd.Next(reminder, gapValue)).ToString() + "," +
        //   (minValue + rnd.Next(reminder, gapValue)).ToString() + ",0.9)";
        
        <div class="grid newsItemBox" style="border:1px solid lightgrey;width:100%;">
        <div style="background-color:@color;height:3px;"></div>
       
        @if (isAdminPortal)
        {
             @feeds[i].ID

            <a target="_blank" class="btn btn-link" href="/adminsection/kwplanner.aspx?feedid=@feeds[i].ID">Details</a>
        
        
     

            
@*      
       <h3> @LuceneWrap.Lib.TempAnalyzer.CleanString(feeds[i].Title,true,false,true,true) </h3>     

         <p>   @feeds[i].Rank </p>
            var timeDiff = Convert.ToInt64((((DateTime.UtcNow - feeds[i].PubDate).TotalHours) / 3));
          
         <p>@timeDiff</p>
         
         <p>   @feeds[i].ImageWidth.ToString() </p>
          <p> length  @feeds[i].Title.Length.ToString() </p>*@
            
        }
        
        @*href="/go?t=@tempTitle&u=@HttpUtility.UrlEncode(feeds[i].Link)"*@

        <div  class="newsItemTitleBox">
        <a class="name newsItemTitleAnchorTag" target="_blank" href="@targetLink" rel="nofollow">
         <span> @Html.Raw(truncatedTitle) </span>
           @if (!string.IsNullOrEmpty(feeds[i].ImageUrl) && IsImageDisplayEnabled)
           {
		        <div class="imgholder newsItemImageBox">
                @*<img class="newsItemImage lazy" data-original="@feeds[i].ImageUrl"  src="/Content/img/grey.gif" w="@imageWidth" h="@imageHeight" />*@

               <img class="newsItemImage" data-original="@feeds[i].ImageUrl"  src="/Content/img/grey.gif" w="@imageWidth" h="@imageHeight" />
		        </div>
           }
           else
           {
                <div></div>
           }

     </a></div>
     <div class="newsItemBoxFooterBox">
        <span>
         <a style="text-decoration: none;color:#888;" title="more from @feeds[i].Domain ..." href="/source/@feeds[i].Domain">
         <img src="https://plus.google.com/_/favicon?alt=feed&amp;domain=@feeds[i].Domain" style="height:20px;width:20px;" alt="@feeds[i].Domain"/>
          @feeds[i].Domain</a>
          </span>
         <span class="pull-right"> <span class="icon-time"></span><span class="timeago" style="color:#f77;margin-left:2px;" title="@feeds[i].PubDate.ToString("yyyy'-'MM'-'dd'T'HH':'mm':'ss'.'fff'Z'")">@feeds[i].PubDate.AddHours(5).AddMinutes(30).ToString("dd/MM/yyyy hh:mm tt")</span></span>
        </div>
         @if (isAdminPortal)
         {
             
                       
             <a href="#myModal-adminoptions-@feeds[i].ID" role="button" class="btn" data-toggle="modal">admin options</a>
             
              <div id="myModal-adminoptions-@feeds[i].ID"  class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false">

                 <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" >×</button>
                <h3 id="myModalLabel">Admin Options</h3>
                 @if (feeds[i].Tags != null)
                 {
                   <div id="tagBox-@feeds[i].ID"></div>
                  
                     foreach (var item in feeds[i].Tags)
                     {
                         ///websiteinfo/addtagtofeed?feedid=2312&tag=mytag3
                         ///websiteinfo/removetagfromfeed?feedid=2312&tag=mytag3
                    <span class="tagBox-@feeds[i].ID" style="border-radius:5px; margin-right:5px;margin-bottom:3px;border:1px solid lightgray;color:Gray;padding:2px;"><span><a href="/category/@selectedLanguage-@item"> @item </a> <a style="color:red;margin-left:1px;" href="javascript:sendAjaxRequestTagModification('/websiteinfo/removetagfromfeed?feedid=@feeds[i].ID&tag=@item',@feeds[i].ID)">&times;</a></span></span>
                     
                     }
            
                
            
            <div class="btn-group"><button class="btn btn-link dropdown-toggle" data-toggle="dropdown">Add new tag:<span class="caret"></span></button>
            <ul class="dropdown-menu" style="text-align:left">
             @foreach (var cat in availableCategories)
             {
                    <li><a target="_blank" href="javascript:sendAjaxRequestTagModification('/websiteinfo/addtagtofeed?feedid=@feeds[i].ID&tag=@cat',@feeds[i].ID)">@cat</a></li>
             }

            </ul></div>

            
                 }
              </div>
               <div class="modal-body">

              <p><h2>@Html.Raw(truncatedTitle)</h2></p>

              
              <a class="btn btn-warning" title="Delete this feed" target="_blank" href="/websiteinfo/DeleteFeedById?feedid=@feeds[i].ID">Delete this feed</a>
              <br/>
              <br/>
              <a class="btn btn-danger" title="Delete this feed" target="_blank" href="/websiteinfo/DeleteFeedByDomain?domain=@feeds[i].Domain">Delete all feeds by @feeds[i].Domain</a>
             <br/>
             <br/>
            
              <a class="name newsItemImageAnchor" title="Publish in facebook" target="_blank" href="/fb?feedId=@HttpUtility.UrlEncode(feeds[i].ID)">
              <span class="icon-thumbs-up" ></span>Publish facebook 
              </a>
              <br/>
              <br/>

             
          
           @if (!string.IsNullOrEmpty(feeds[i].ImageUrl) && IsImageDisplayEnabled)
           {
		       
             
             <p>
               <img class="newsItemImage" data-original="@feeds[i].ImageUrl"  src="/Content/img/grey.gif" w="@imageWidth" h="@imageHeight" />
		       </p>
           }

           </div>
            <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" >Close</button>
                  </div>
          </div>
         }
	</div>
    }
        }
</div>

 @RenderPage("~/views/shared/_pagerView.cshtml")
  
@*<div style="width:100%;height:auto;border-top:4px double #77c;border-bottom:4px double #77c;text-align:center;">
<h4 style="color:#333;text-shadow:-1px 1px 2px grey;">OUR RESPECTFUL NEWS SOURCES</h4>
</div>*@
<hr />

 <div id="websiteContainer" style="width: 1100px;position:relative;margin:0 auto 25px;border-top:#000;">
      <div class="clearfix" style="text-align:left;">
              <ul class="nav nav-pills" style="display: block; position: static; margin-bottom: 5px;">
                @{
                    // var currentDomain = ((QResult)Model).CurrentDomain;
                    //string selectedDomainName = string.Empty;
                    if (currentDomain != null)
                    {
                        selectedDomainName = currentDomain.Domain;
                    }
                    websites = ((QResult)Model).CurrentLanguageWebsites;

                    foreach (var website in websites)
                    {
                        if (isFeedIsAvailable == false)
                        {
                            break;
                        }

                        if (!string.IsNullOrEmpty(selectedDomainName) && selectedDomainName.ToLower() == website.Domain.ToLower())
                        {
                            <li class="active"><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" rel="nofollow">
                        <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(website.Name)
                    </a></li>
                        }
                        else
                        {
                            <li><a tabindex="-1"  style="margin:5px;padding-right:5px;font-size:15px;" href="/source/@website.Domain" rel="nofollow">
                        <img src='https://plus.google.com/_/favicon?alt=feed&domain=@website.Domain ' style="padding-right:8px;width:20px;"/>@Html.Raw(website.Name)
                    </a></li>
                        }
                    }
            }
              </ul>
            </div>
      @{
                
          List<NewsMine.DomainObjects.WebSiteInfo> websites1 = new List<NewsMine.DomainObjects.WebSiteInfo>();

          websites1 = ((QResult)Model).CurrentLanguageWebsites;

          foreach (var website in websites1)
          {


              continue;
              if (!string.IsNullOrEmpty(website.Logo1Uri))
              {
                <div class="grid" style="border-radius:25px;text-align:center;position:relative;border:0px solid lightgrey;">
                      <a class="name" style="text-decoration:none;text-align:center;left:50%;top:50%;" target="_self" href="/source/@website.Domain">
			        <img style="width:100%;max-height:auto;margin-left:auto;margin-right: auto;" Title="@Html.Raw(website.Name)" src="@website.Logo1Uri" />
                </a>
              </div>

              }
          }
       }
    </div>
</section>
